![]() |
PtInIconMethod |
||||
Header: | Icons.h | Carbon status: | Supported | |
Determines whether a specified point is within an icon obtained with the aid of your icon getter callback function.
Boolean PtInIconMethod ( Point testPt, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr );
The point to be tested, specified in local coordinates of the current graphics port. A point is considered to be within an icon if the point is within the icon’s mask.
A pointer to the rectangle in which the icon appears, specified in local coordinates of the current graphics port. The rectangle which you specify here should be the same rectangle that you last used to draw the icon.
Specifies how the icon against which to hit-test is aligned within the rectangle specified by the iconRect parameter. The alignment which you specify here should be the same alignment that you last used to draw the icon. See
A universal procedure pointer to your icon getter callback function. PtInIconMethod passes to your icon getter function the type of icon your function should retrieve (either 'ICN#' or 'ics#') and also passes the value specified in the yourDataPtr parameter. The PtInIconMethod function examines the size of the specified rectangle and requests the appropriate icon from your icon getter function. Your icon getter function should return a handle to the requested icon’s data. The PtInIconMethod function extracts the mask from the icon data that your icon getter function returns. If your icon getter function returns data that does not correspond to an icon of type 'ICN#' or type 'ics#', PtInIconMethod attempts to generate a mask from the returned data.
Your icon getter function can get the icon’s data using whatever method is appropriate to your application. For example, your application might maintain its own cache of icons (and pass a pointer to it in the yourDataPtr parameter) or use its icon getter function to get an icon from the desktop database.
See the IconGetterProcPtr callback for more information on creating an icon getter function.
A pointer to data that is passed to your icon getter function.
TRUE if the point is in the icon and FALSE if it is not.
This function may move or purge memory blocks in the application heap. For that reason, your application should not call it at interrupt time.
Supported in Carbon. Available in CarbonLib 1.0 and later when InterfaceLib 7.1 or later is installed. Exported by CarbonLib 1.0 and later and by InterfaceLib 7.1 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/18/2000)